package cn.myschool.service;

import cn.myschool.dao.AdminDao;
import cn.myschool.entity.Admin;
import cn.myschool.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author oldliu
 * @since 1.0
 */
public class AdminService {
    public static final Logger Log = LoggerFactory.getLogger(AdminService.class);
    public static AdminService ME = new AdminService();
    public static final int PAGESIZE=10;//默认页大小


    public Admin login(String name,String pass) {
        SqlSession sq = MybatisUtil.get();
        try {
            AdminDao mapper = sq.getMapper(AdminDao.class);
            return mapper.login(name,pass);
        } finally {
            MybatisUtil.close(sq);
        }
    }

}
